{include file="public/header" /}
<style>
    body{
        background: #FFF;
    }
    .page{
        min-height: auto;
    }
</style>
<div class="page">
    <form method="post" name="remark_form" id="remark_form">
        <table class="ds-default-table nobdb">
            <tr>
                <td><label>额度：</label></td>
                <td><input  type="text"  name="credit_num"  value="<?php if(isset($store_info)&&!empty($store_info['credit_num'])){ echo $store_info['credit_num']; }?>"></td>
            </tr>
           <!--  <tr> <input type="hidden" name="store_id" value="{$store_info.store_id}">
               <td><label>授信开始时间：</label></td>
               <td> <input  type="text" id="sdate" name="credit_create_time" class="txt date" value="<?php if(isset($store_info)&&!empty($store_info['credit_create_time'])){ echo date('Y-m-d',$store_info['credit_create_time']); }?>"></td>
           </tr>
           <tr>
               <td><label>授信结束时间：</label></td>
               <td><input  type="text" id="edate" name="credit_end_time" class="txt date" value="<?php if(isset($store_info)&&!empty($store_info['credit_end_time'])){ echo date('Y-m-d',$store_info['credit_end_time']); }?>"></td>
           </tr> -->
             <tr> <input type="hidden" name="store_id" value="{$store_info.store_id}">
              <td><label>账期天数：</label></td>
              <td> <input  type="text"  name="credit_day" value="<?php if(isset($store_info)&&!empty($store_info['credit_day'])){ 
                echo $store_info['credit_day']; }?>"></td>             
            </tr>
            <tr>
                <td><input type="submit" class="submit" value="提交"></td>
                <td></td>
            </tr>
        </table>
    </form></div>


<script>

    $('#sdate').datepicker({dateFormat: 'yy-mm-dd'});
    $('#edate').datepicker({dateFormat: 'yy-mm-dd'});





    $(document).ready(function(){
        $('form').submit(function(){
        var credit_num = $("input[name='credit_num']").val();
        var credit_day = $("input[name='credit_day']").val();

        if(credit_num === "" || credit_num ==null){
      layer.msg('请设置正确的授信额度');return false;
　　}
     if(isNaN(credit_num)){　　　　
　　　  layer.msg('请设置正确的授信额度');return false;
　  　}
    if(credit_num<=0){　　　　
　　　  layer.msg('请设置正确的授信额度');return false;
　  　}
     if(!/^[0-9]*[1-9][0-9]*$/.test(credit_day)){
       layer.msg('请设置正确的授信天数');return false;
     
     }
      
    });
        
    })

</script>
